﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SynoManager.Utils;

namespace SynoManager.GUI
{
    public partial class MainPreferencesPanel : PreferencesPanel
    {
        public MainPreferencesPanel()
        {
            InitializeComponent();

            autoCheckUpdatesCheckBox.Checked = Properties.Settings.Default.AutoCheckUpdates;
        }

        public override void Save()
        {
            Properties.Settings.Default.AutoCheckUpdates = autoCheckUpdatesCheckBox.Checked;
        }

        private void checkNowButton_Click(object sender, EventArgs e)
        {
            UpdateChecker.CheckUpdateAndShowWindow(FindForm());
        }

        private void addWindowsStartupButton_Click(object sender, EventArgs e)
        {
            StartWithWindows.AddToStartupFolder();
        }
    }
}
